home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / autoconf.10 / autoconf / autoconf-2.10 / acgeneral.m4 < prev    next >
Encoding:
M4 Source File  |  1996-05-07  |  68.8 KB  |  2,298 lines

  1. dnl Parameterized macros.
  2. dnl Requires GNU m4.
  3. dnl This file is part of Autoconf.
  4. dnl Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
  5. dnl
  6. dnl This program is free software; you can redistribute it and/or modify
  7. dnl it under the terms of the GNU General Public License as published by
  8. dnl the Free Software Foundation; either version 2, or (at your option)
  9. dnl any later version.
  10. dnl
  11. dnl This program is distributed in the hope that it will be useful,
  12. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. dnl GNU General Public License for more details.
  15. dnl
  16. dnl You should have received a copy of the GNU General Public License
  17. dnl along with this program; if not, write to the Free Software
  18. dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. dnl
  20. dnl As a special exception, the Free Software Foundation gives unlimited
  21. dnl permission to copy, distribute and modify the configure scripts that
  22. dnl are the output of Autoconf.  You need not follow the terms of the GNU
  23. dnl General Public License when using or distributing such scripts, even
  24. dnl though portions of the text of Autoconf appear in them.  The GNU
  25. dnl General Public License (GPL) does govern all other use of the material
  26. dnl that constitutes the Autoconf program.
  27. dnl
  28. dnl Certain portions of the Autoconf source text are designed to be copied
  29. dnl (in certain cases, depending on the input) into the output of
  30. dnl Autoconf.  We call these the "data" portions.  The rest of the Autoconf
  31. dnl source text consists of comments plus executable code that decides which
  32. dnl of the data portions to output in any given case.  We call these
  33. dnl comments and executable code the "non-data" portions.  Autoconf never
  34. dnl copies any of the non-data portions into its output.
  35. dnl
  36. dnl This special exception to the GPL applies to versions of Autoconf
  37. dnl released by the Free Software Foundation.  When you make and
  38. dnl distribute a modified version of Autoconf, you may extend this special
  39. dnl exception to the GPL to apply to your modified version as well, *unless*
  40. dnl your modified version has the potential to copy into its output some
  41. dnl of the text that was the non-data portion of the version that you started
  42. dnl with.  (In other words, unless your change moves or copies text from
  43. dnl the non-data portions to the data portions.)  If your modification has
  44. dnl such potential, you must delete any notice of this special exception
  45. dnl to the GPL from your modified version.
  46. dnl
  47. dnl Written by David MacKenzie, with help from
  48. dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
  49. dnl Roland McGrath, Noah Friedman, david d zuhn, and many others.
  50. dnl
  51. divert(-1)dnl Throw away output until AC_INIT is called.
  52. changequote([, ])
  53.  
  54. define(AC_ACVERSION, 2.10)
  55.  
  56. dnl Some old m4's don't support m4exit.  But they provide
  57. dnl equivalent functionality by core dumping because of the
  58. dnl long macros we define.
  59. ifdef([__gnu__], , [errprint(Autoconf requires GNU m4.
  60. Install it before installing Autoconf or set the
  61. M4 environment variable to its path name.
  62. )m4exit(2)])
  63.  
  64. undefine([eval])
  65. undefine([include])
  66. undefine([shift])
  67. undefine([format])
  68.  
  69.  
  70. dnl ### Defining macros
  71.  
  72.  
  73. dnl m4 output diversions.  We let m4 output them all in order at the end,
  74. dnl except that we explicitly undivert AC_DIVERSION_SED.
  75.  
  76. dnl AC_DIVERSION_NOTICE - 1 (= 0)    AC_REQUIRE'd #! /bin/sh line
  77. define(AC_DIVERSION_NOTICE, 1)dnl    copyright notice & option help strings
  78. define(AC_DIVERSION_INIT, 2)dnl        initialization code
  79. define(AC_DIVERSION_SED, 3)dnl        variable substitutions in config.status
  80. define(AC_DIVERSION_NORMAL_4, 4)dnl    AC_REQUIRE'd code, 4 level deep
  81. define(AC_DIVERSION_NORMAL_3, 5)dnl    AC_REQUIRE'd code, 3 level deep
  82. define(AC_DIVERSION_NORMAL_2, 6)dnl    AC_REQUIRE'd code, 2 level deep
  83. define(AC_DIVERSION_NORMAL_1, 7)dnl    AC_REQUIRE'd code, 1 level deep
  84. define(AC_DIVERSION_NORMAL, 8)dnl    the tests and output code
  85.  
  86. dnl Change the diversion stream to STREAM, while stacking old values.
  87. dnl AC_DIVERT_PUSH(STREAM)
  88. define(AC_DIVERT_PUSH,
  89. [pushdef([AC_DIVERSION_CURRENT], $1)dnl
  90. divert(AC_DIVERSION_CURRENT)dnl
  91. ])
  92.  
  93. dnl Change the diversion stream to its previous value, unstacking it.
  94. dnl AC_DIVERT_POP()
  95. define(AC_DIVERT_POP,
  96. [popdef([AC_DIVERSION_CURRENT])dnl
  97. divert(AC_DIVERSION_CURRENT)dnl
  98. ])
  99.  
  100. dnl Initialize the diversion setup.
  101. define([AC_DIVERSION_CURRENT], AC_DIVERSION_NORMAL)
  102. dnl This will be popped by AC_REQUIRE in AC_INIT.
  103. pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_NOTICE)
  104.  
  105. dnl The prologue for Autoconf macros.
  106. dnl AC_PRO(MACRO-NAME)
  107. define(AC_PRO,
  108. [define([AC_PROVIDE_$1], )dnl
  109. ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL,
  110. [AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))],
  111. [pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_CURRENT)])dnl
  112. ])
  113.  
  114. dnl The Epilogue for Autoconf macros.
  115. dnl AC_EPI()
  116. define(AC_EPI,
  117. [AC_DIVERT_POP()dnl
  118. ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL,
  119. [undivert(AC_DIVERSION_NORMAL_4)dnl
  120. undivert(AC_DIVERSION_NORMAL_3)dnl
  121. undivert(AC_DIVERSION_NORMAL_2)dnl
  122. undivert(AC_DIVERSION_NORMAL_1)dnl
  123. ])dnl
  124. ])
  125.  
  126. dnl Define a macro which automatically provides itself.  Add machinery
  127. dnl so the macro automatically switches expansion to the diversion
  128. dnl stack if it is not already using it.  In this case, once finished,
  129. dnl it will bring back all the code accumulated in the diversion stack.
  130. dnl This, combined with AC_REQUIRE, achieves the topological ordering of
  131. dnl macros.  We don't use this macro to define some frequently called
  132. dnl macros that are not involved in ordering constraints, to save m4
  133. dnl processing.
  134. dnl AC_DEFUN(NAME, EXPANSION)
  135. define([AC_DEFUN],
  136. [define($1, [AC_PRO([$1])$2[]AC_EPI()])])
  137.  
  138.  
  139. dnl ### Initialization
  140.  
  141.  
  142. dnl AC_INIT_NOTICE()
  143. AC_DEFUN(AC_INIT_NOTICE,
  144. [# Guess values for system-dependent variables and create Makefiles.
  145. # Generated automatically using autoconf version] AC_ACVERSION [
  146. # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
  147. #
  148. # This configure script is free software; the Free Software Foundation
  149. # gives unlimited permission to copy, distribute and modify it.
  150.  
  151. # Defaults:
  152. ac_help=
  153. ac_default_prefix=/usr/local
  154. [#] Any additions from configure.in:])
  155.  
  156. dnl AC_PREFIX_DEFAULT(PREFIX)
  157. AC_DEFUN(AC_PREFIX_DEFAULT,
  158. [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
  159. ac_default_prefix=$1
  160. AC_DIVERT_POP()])
  161.  
  162. dnl AC_INIT_PARSE_ARGS()
  163. AC_DEFUN(AC_INIT_PARSE_ARGS,
  164. [
  165. # Initialize some variables set by options.
  166. # The variables have the same names as the options, with
  167. # dashes changed to underlines.
  168. build=NONE
  169. cache_file=./config.cache
  170. exec_prefix=NONE
  171. host=NONE
  172. no_create=
  173. nonopt=NONE
  174. no_recursion=
  175. prefix=NONE
  176. program_prefix=NONE
  177. program_suffix=NONE
  178. program_transform_name=s,x,x,
  179. silent=
  180. site=
  181. srcdir=
  182. target=NONE
  183. verbose=
  184. x_includes=NONE
  185. x_libraries=NONE
  186. dnl Installation directory options.
  187. bindir='${exec_prefix}/bin'
  188. sbindir='${exec_prefix}/sbin'
  189. libexecdir='${exec_prefix}/libexec'
  190. datadir='${prefix}/share'
  191. sysconfdir='${prefix}/etc'
  192. sharedstatedir='${prefix}/com'
  193. localstatedir='${prefix}/var'
  194. libdir='${exec_prefix}/lib'
  195. includedir='${prefix}/include'
  196. oldincludedir='/usr/include'
  197. infodir='${prefix}/info'
  198. mandir='${prefix}/man'
  199.  
  200. # Initialize some other variables.
  201. subdirs=
  202. MFLAGS= MAKEFLAGS=
  203.  
  204. ac_prev=
  205. for ac_option
  206. do
  207.  
  208.   # If the previous option needs an argument, assign it.
  209.   if test -n "$ac_prev"; then
  210.     eval "$ac_prev=\$ac_option"
  211.     ac_prev=
  212.     continue
  213.   fi
  214.  
  215.   case "$ac_option" in
  216. changequote(, )dnl
  217.   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  218. changequote([, ])dnl
  219.   *) ac_optarg= ;;
  220.   esac
  221.  
  222.   # Accept the important Cygnus configure options, so we can diagnose typos.
  223.  
  224.   case "$ac_option" in
  225.  
  226.   -bindir | --bindir | --bindi | --bind | --bin | --bi)
  227.     ac_prev=bindir ;;
  228.   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
  229.     bindir="$ac_optarg" ;;
  230.  
  231.   -build | --build | --buil | --bui | --bu)
  232.     ac_prev=build ;;
  233.   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
  234.     build="$ac_optarg" ;;
  235.  
  236.   -cache-file | --cache-file | --cache-fil | --cache-fi \
  237.   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
  238.     ac_prev=cache_file ;;
  239.   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  240.   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
  241.     cache_file="$ac_optarg" ;;
  242.  
  243.   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
  244.     ac_prev=datadir ;;
  245.   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
  246.   | --da=*)
  247.     datadir="$ac_optarg" ;;
  248.  
  249.   -disable-* | --disable-*)
  250.     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
  251.     # Reject names that are not valid shell variable names.
  252. changequote(, )dnl
  253.     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
  254. changequote([, ])dnl
  255.       AC_MSG_ERROR($ac_feature: invalid feature name)
  256.     fi
  257.     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
  258.     eval "enable_${ac_feature}=no" ;;
  259.  
  260.   -enable-* | --enable-*)
  261.     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
  262.     # Reject names that are not valid shell variable names.
  263. changequote(, )dnl
  264.     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
  265. changequote([, ])dnl
  266.       AC_MSG_ERROR($ac_feature: invalid feature name)
  267.     fi
  268.     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
  269.     case "$ac_option" in
  270.       *=*) ;;
  271.       *) ac_optarg=yes ;;
  272.     esac
  273.     eval "enable_${ac_feature}='$ac_optarg'" ;;
  274.  
  275.   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  276.   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  277.   | --exec | --exe | --ex)
  278.     ac_prev=exec_prefix ;;
  279.   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  280.   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  281.   | --exec=* | --exe=* | --ex=*)
  282.     exec_prefix="$ac_optarg" ;;
  283.  
  284.   -gas | --gas | --ga | --g)
  285.     # Obsolete; use --with-gas.
  286.     with_gas=yes ;;
  287.  
  288.   -help | --help | --hel | --he)
  289.     # Omit some internal or obsolete options to make the list less imposing.
  290.     # This message is too long to be a string in the A/UX 3.1 sh.
  291.     cat << EOF
  292. changequote(, )dnl
  293. Usage: configure [options] [host]
  294. Options: [defaults in brackets after descriptions]
  295. Configuration:
  296.   --cache-file=FILE       cache test results in FILE
  297.   --help                  print this message
  298.   --no-create             do not create output files
  299.   --quiet, --silent       do not print \`checking...' messages
  300.   --version               print the version of autoconf that created configure
  301. Directory and file names:
  302.   --prefix=PREFIX         install architecture-independent files in PREFIX
  303.                           [$ac_default_prefix]
  304.   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
  305.                           [same as prefix]
  306.   --bindir=DIR            user executables in DIR [EPREFIX/bin]
  307.   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
  308.   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
  309.   --datadir=DIR           read-only architecture-independent data in DIR
  310.                           [PREFIX/share]
  311.   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
  312.   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
  313.                           [PREFIX/com]
  314.   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
  315.   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  316.   --includedir=DIR        C header files in DIR [PREFIX/include]
  317.   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
  318.   --infodir=DIR           info documentation in DIR [PREFIX/info]
  319.   --mandir=DIR            man documentation in DIR [PREFIX/man]
  320.   --srcdir=DIR            find the sources in DIR [configure dir or ..]
  321.   --program-prefix=PREFIX prepend PREFIX to installed program names
  322.   --program-suffix=SUFFIX append SUFFIX to installed program names
  323.   --program-transform-name=PROGRAM
  324.                           run sed PROGRAM on installed program names
  325. EOF
  326.     cat << EOF
  327. Host type:
  328.   --build=BUILD           configure for building on BUILD [BUILD=HOST]
  329.   --host=HOST             configure for HOST [guessed]
  330.   --target=TARGET         configure for TARGET [TARGET=HOST]
  331. Features and packages:
  332.   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  333.   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  334.   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  335.   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  336.   --x-includes=DIR        X include files are in DIR
  337.   --x-libraries=DIR       X library files are in DIR
  338. changequote([, ])dnl
  339. EOF
  340.     if test -n "$ac_help"; then
  341.       echo "--enable and --with options recognized:$ac_help"
  342.     fi
  343.     exit 0 ;;
  344.  
  345.   -host | --host | --hos | --ho)
  346.     ac_prev=host ;;
  347.   -host=* | --host=* | --hos=* | --ho=*)
  348.     host="$ac_optarg" ;;
  349.  
  350.   -includedir | --includedir | --includedi | --included | --include \
  351.   | --includ | --inclu | --incl | --inc)
  352.     ac_prev=includedir ;;
  353.   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  354.   | --includ=* | --inclu=* | --incl=* | --inc=*)
  355.     includedir="$ac_optarg" ;;
  356.  
  357.   -infodir | --infodir | --infodi | --infod | --info | --inf)
  358.     ac_prev=infodir ;;
  359.   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
  360.     infodir="$ac_optarg" ;;
  361.  
  362.   -libdir | --libdir | --libdi | --libd)
  363.     ac_prev=libdir ;;
  364.   -libdir=* | --libdir=* | --libdi=* | --libd=*)
  365.     libdir="$ac_optarg" ;;
  366.  
  367.   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  368.   | --libexe | --libex | --libe)
  369.     ac_prev=libexecdir ;;
  370.   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  371.   | --libexe=* | --libex=* | --libe=*)
  372.     libexecdir="$ac_optarg" ;;
  373.  
  374.   -localstatedir | --localstatedir | --localstatedi | --localstated \
  375.   | --localstate | --localstat | --localsta | --localst \
  376.   | --locals | --local | --loca | --loc | --lo)
  377.     ac_prev=localstatedir ;;
  378.   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  379.   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
  380.   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
  381.     localstatedir="$ac_optarg" ;;
  382.  
  383.   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
  384.     ac_prev=mandir ;;
  385.   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
  386.     mandir="$ac_optarg" ;;
  387.  
  388.   -nfp | --nfp | --nf)
  389.     # Obsolete; use --without-fp.
  390.     with_fp=no ;;
  391.  
  392.   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  393.   | --no-cr | --no-c)
  394.     no_create=yes ;;
  395.  
  396.   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  397.   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
  398.     no_recursion=yes ;;
  399.  
  400.   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  401.   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  402.   | --oldin | --oldi | --old | --ol | --o)
  403.     ac_prev=oldincludedir ;;
  404.   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  405.   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  406.   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
  407.     oldincludedir="$ac_optarg" ;;
  408.  
  409.   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  410.     ac_prev=prefix ;;
  411.   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  412.     prefix="$ac_optarg" ;;
  413.  
  414.   -program-prefix | --program-prefix | --program-prefi | --program-pref \
  415.   | --program-pre | --program-pr | --program-p)
  416.     ac_prev=program_prefix ;;
  417.   -program-prefix=* | --program-prefix=* | --program-prefi=* \
  418.   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
  419.     program_prefix="$ac_optarg" ;;
  420.  
  421.   -program-suffix | --program-suffix | --program-suffi | --program-suff \
  422.   | --program-suf | --program-su | --program-s)
  423.     ac_prev=program_suffix ;;
  424.   -program-suffix=* | --program-suffix=* | --program-suffi=* \
  425.   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
  426.     program_suffix="$ac_optarg" ;;
  427.  
  428.   -program-transform-name | --program-transform-name \
  429.   | --program-transform-nam | --program-transform-na \
  430.   | --program-transform-n | --program-transform- \
  431.   | --program-transform | --program-transfor \
  432.   | --program-transfo | --program-transf \
  433.   | --program-trans | --program-tran \
  434.   | --progr-tra | --program-tr | --program-t)
  435.     ac_prev=program_transform_name ;;
  436.   -program-transform-name=* | --program-transform-name=* \
  437.   | --program-transform-nam=* | --program-transform-na=* \
  438.   | --program-transform-n=* | --program-transform-=* \
  439.   | --program-transform=* | --program-transfor=* \
  440.   | --program-transfo=* | --program-transf=* \
  441.   | --program-trans=* | --program-tran=* \
  442.   | --progr-tra=* | --program-tr=* | --program-t=*)
  443.     program_transform_name="$ac_optarg" ;;
  444.  
  445.   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  446.   | -silent | --silent | --silen | --sile | --sil)
  447.     silent=yes ;;
  448.  
  449.   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
  450.     ac_prev=sbindir ;;
  451.   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  452.   | --sbi=* | --sb=*)
  453.     sbindir="$ac_optarg" ;;
  454.  
  455.   -sharedstatedir | --sharedstatedir | --sharedstatedi \
  456.   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
  457.   | --sharedst | --shareds | --shared | --share | --shar \
  458.   | --sha | --sh)
  459.     ac_prev=sharedstatedir ;;
  460.   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  461.   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  462.   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  463.   | --sha=* | --sh=*)
  464.     sharedstatedir="$ac_optarg" ;;
  465.  
  466.   -site | --site | --sit)
  467.     ac_prev=site ;;
  468.   -site=* | --site=* | --sit=*)
  469.     site="$ac_optarg" ;;
  470.  
  471.   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  472.     ac_prev=srcdir ;;
  473.   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  474.     srcdir="$ac_optarg" ;;
  475.  
  476.   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
  477.   | --syscon | --sysco | --sysc | --sys | --sy)
  478.     ac_prev=sysconfdir ;;
  479.   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
  480.   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
  481.     sysconfdir="$ac_optarg" ;;
  482.  
  483.   -target | --target | --targe | --targ | --tar | --ta | --t)
  484.     ac_prev=target ;;
  485.   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  486.     target="$ac_optarg" ;;
  487.  
  488.   -v | -verbose | --verbose | --verbos | --verbo | --verb)
  489.     verbose=yes ;;
  490.  
  491.   -version | --version | --versio | --versi | --vers)
  492.     echo "configure generated by autoconf version AC_ACVERSION"
  493.     exit 0 ;;
  494.  
  495.   -with-* | --with-*)
  496.     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
  497.     # Reject names that are not valid shell variable names.
  498. changequote(, )dnl
  499.     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
  500. changequote([, ])dnl
  501.       AC_MSG_ERROR($ac_package: invalid package name)
  502.     fi
  503.     ac_package=`echo $ac_package| sed 's/-/_/g'`
  504.     case "$ac_option" in
  505.       *=*) ;;
  506.       *) ac_optarg=yes ;;
  507.     esac
  508.     eval "with_${ac_package}='$ac_optarg'" ;;
  509.  
  510.   -without-* | --without-*)
  511.     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
  512.     # Reject names that are not valid shell variable names.
  513. changequote(, )dnl
  514.     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  515. changequote([, ])dnl
  516.       AC_MSG_ERROR($ac_package: invalid package name)
  517.     fi
  518.     ac_package=`echo $ac_package| sed 's/-/_/g'`
  519.     eval "with_${ac_package}=no" ;;
  520.  
  521.   --x)
  522.     # Obsolete; use --with-x.
  523.     with_x=yes ;;
  524.  
  525.   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  526.   | --x-incl | --x-inc | --x-in | --x-i)
  527.     ac_prev=x_includes ;;
  528.   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  529.   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
  530.     x_includes="$ac_optarg" ;;
  531.  
  532.   -x-libraries | --x-libraries | --x-librarie | --x-librari \
  533.   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
  534.     ac_prev=x_libraries ;;
  535.   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  536.   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
  537.     x_libraries="$ac_optarg" ;;
  538.  
  539.   -*) AC_MSG_ERROR([$ac_option: invalid option; use --help to show usage])
  540.     ;;
  541.  
  542.   *)
  543. changequote(, )dnl
  544.     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
  545. changequote([, ])dnl
  546.       AC_MSG_WARN($ac_option: invalid host type)
  547.     fi
  548.     if test "x$nonopt" != xNONE; then
  549.       AC_MSG_ERROR(can only configure for one host and one target at a time)
  550.     fi
  551.     nonopt="$ac_option"
  552.     ;;
  553.  
  554.   esac
  555. done
  556.  
  557. if test -n "$ac_prev"; then
  558.   AC_MSG_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`)
  559. fi
  560. ])
  561.  
  562. dnl Try to have only one #! line, so the script doesn't look funny
  563. dnl for users of AC_REVISION.
  564. dnl AC_INIT_BINSH()
  565. AC_DEFUN(AC_INIT_BINSH,
  566. [#! /bin/sh
  567. ])
  568.  
  569. dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR)
  570. AC_DEFUN(AC_INIT,
  571. [sinclude(acsite.m4)dnl
  572. sinclude(./aclocal.m4)dnl
  573. AC_REQUIRE([AC_INIT_BINSH])dnl
  574. AC_INIT_NOTICE
  575. AC_DIVERT_POP()dnl to NORMAL
  576. AC_DIVERT_PUSH(AC_DIVERSION_INIT)dnl
  577. AC_INIT_PARSE_ARGS
  578. AC_INIT_PREPARE($1)dnl
  579. AC_DIVERT_POP()dnl to NORMAL
  580. ])
  581.  
  582. dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
  583. AC_DEFUN(AC_INIT_PREPARE,
  584. [trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
  585.  
  586. # File descriptor usage:
  587. # 0 standard input
  588. # 1 file creation
  589. # 2 errors and warnings
  590. # 3 some systems may open it to /dev/tty
  591. # 4 used on the Kubota Titan
  592. define(AC_FD_MSG, 6)dnl
  593. [#] AC_FD_MSG checking for... messages and results
  594. define(AC_FD_CC, 5)dnl
  595. [#] AC_FD_CC compiler messages saved in config.log
  596. if test "$silent" = yes; then
  597.   exec AC_FD_MSG>/dev/null
  598. else
  599.   exec AC_FD_MSG>&1
  600. fi
  601. exec AC_FD_CC>./config.log
  602.  
  603. echo "\
  604. This file contains any messages produced by compilers while
  605. running configure, to aid debugging if configure makes a mistake.
  606. " 1>&AC_FD_CC
  607.  
  608. # Strip out --no-create and --no-recursion so they do not pile up.
  609. # Also quote any args containing shell metacharacters.
  610. ac_configure_args=
  611. for ac_arg
  612. do
  613.   case "$ac_arg" in
  614.   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  615.   | --no-cr | --no-c) ;;
  616.   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  617.   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
  618. changequote(<<, >>)dnl
  619. dnl If you change this globbing pattern, test it on an old shell --
  620. dnl it's sensitive.  Putting any kind of quote in it causes syntax errors.
  621.   *" "*|*"    "*|*[\[\]\~\<<#>>\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  622.   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  623. changequote([, ])dnl
  624.   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
  625.   esac
  626. done
  627.  
  628. # NLS nuisances.
  629. # Only set LANG and LC_ALL to C if already set.
  630. # These must not be set unconditionally because not all systems understand
  631. # e.g. LANG=C (notably SCO).
  632. if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  633. if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
  634.  
  635. # confdefs.h avoids OS command line length limits that DEFS can exceed.
  636. rm -rf conftest* confdefs.h
  637. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  638. echo > confdefs.h
  639.  
  640. # A filename unique to this package, relative to the directory that
  641. # configure is in, which we can look for to find out if srcdir is correct.
  642. ac_unique_file=$1
  643.  
  644. # Find the source files, if location was not specified.
  645. if test -z "$srcdir"; then
  646.   ac_srcdir_defaulted=yes
  647.   # Try the directory containing this script, then its parent.
  648.   ac_prog=[$]0
  649. changequote(, )dnl
  650.   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  651. changequote([, ])dnl
  652.   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  653.   srcdir=$ac_confdir
  654.   if test ! -r $srcdir/$ac_unique_file; then
  655.     srcdir=..
  656.   fi
  657. else
  658.   ac_srcdir_defaulted=no
  659. fi
  660. if test ! -r $srcdir/$ac_unique_file; then
  661.   if test "$ac_srcdir_defaulted" = yes; then
  662.     AC_MSG_ERROR(can not find sources in $ac_confdir or ..)
  663.   else
  664.     AC_MSG_ERROR(can not find sources in $srcdir)
  665.   fi
  666. fi
  667. dnl Double slashes in pathnames in object file debugging info
  668. dnl mess up M-x gdb in Emacs.
  669. changequote(, )dnl
  670. srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
  671. changequote([, ])dnl
  672.  
  673. dnl Let the site file select an alternate cache file if it wants to.
  674. AC_SITE_LOAD
  675. AC_CACHE_LOAD
  676. AC_LANG_C
  677. AC_PROG_ECHO_N
  678. dnl Substitute for predefined variables.
  679. AC_SUBST(CFLAGS)dnl
  680. AC_SUBST(CPPFLAGS)dnl
  681. AC_SUBST(CXXFLAGS)dnl
  682. AC_SUBST(DEFS)dnl
  683. AC_SUBST(LDFLAGS)dnl
  684. AC_SUBST(LIBS)dnl
  685. AC_SUBST(exec_prefix)dnl
  686. AC_SUBST(prefix)dnl
  687. AC_SUBST(program_transform_name)dnl
  688. dnl Installation directory options.
  689. AC_SUBST(bindir)dnl
  690. AC_SUBST(sbindir)dnl
  691. AC_SUBST(libexecdir)dnl
  692. AC_SUBST(datadir)dnl
  693. AC_SUBST(sysconfdir)dnl
  694. AC_SUBST(sharedstatedir)dnl
  695. AC_SUBST(localstatedir)dnl
  696. AC_SUBST(libdir)dnl
  697. AC_SUBST(includedir)dnl
  698. AC_SUBST(oldincludedir)dnl
  699. AC_SUBST(infodir)dnl
  700. AC_SUBST(mandir)dnl
  701. ])
  702.  
  703.  
  704. dnl ### Selecting optional features
  705.  
  706.  
  707. dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
  708. AC_DEFUN(AC_ARG_ENABLE,
  709. [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
  710. ac_help="$ac_help
  711. [$2]"
  712. AC_DIVERT_POP()dnl
  713. [#] Check whether --enable-[$1] or --disable-[$1] was given.
  714. if test "[${enable_]patsubst([$1], -, _)+set}" = set; then
  715.   enableval="[$enable_]patsubst([$1], -, _)"
  716.   ifelse([$3], , :, [$3])
  717. ifelse([$4], , , [else
  718.   $4
  719. ])dnl
  720. fi
  721. ])
  722.  
  723. AC_DEFUN(AC_ENABLE,
  724. [AC_OBSOLETE([$0], [; instead use AC_ARG_ENABLE])dnl
  725. AC_ARG_ENABLE([$1], [  --enable-$1], [$2], [$3])dnl
  726. ])
  727.  
  728.  
  729. dnl ### Working with optional software
  730.  
  731.  
  732. dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
  733. AC_DEFUN(AC_ARG_WITH,
  734. [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
  735. ac_help="$ac_help
  736. [$2]"
  737. AC_DIVERT_POP()dnl
  738. [#] Check whether --with-[$1] or --without-[$1] was given.
  739. if test "[${with_]patsubst([$1], -, _)+set}" = set; then
  740.   withval="[$with_]patsubst([$1], -, _)"
  741.   ifelse([$3], , :, [$3])
  742. ifelse([$4], , , [else
  743.   $4
  744. ])dnl
  745. fi
  746. ])
  747.  
  748. AC_DEFUN(AC_WITH,
  749. [AC_OBSOLETE([$0], [; instead use AC_ARG_WITH])dnl
  750. AC_ARG_WITH([$1], [  --with-$1], [$2], [$3])dnl
  751. ])
  752.  
  753.  
  754. dnl ### Transforming program names.
  755.  
  756.  
  757. dnl AC_ARG_PROGRAM()
  758. AC_DEFUN(AC_ARG_PROGRAM,
  759. [if test "$program_transform_name" = s,x,x,; then
  760.   program_transform_name=
  761. else
  762.   # Double any \ or $.  echo might interpret backslashes.
  763.   cat <<\EOF_SED > conftestsed
  764. s,\\,\\\\,g; s,\$,$$,g
  765. EOF_SED
  766.   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
  767.   rm -f conftestsed
  768. fi
  769. test "$program_prefix" != NONE &&
  770.   program_transform_name="s,^,${program_prefix},; $program_transform_name"
  771. # Use a double $ so make ignores it.
  772. test "$program_suffix" != NONE &&
  773.   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
  774.  
  775. # sed with no file args requires a program.
  776. test "$program_transform_name" = "" && program_transform_name="s,x,x,"
  777. ])
  778.  
  779.  
  780. dnl ### Version numbers
  781.  
  782.  
  783. dnl AC_REVISION(REVISION-INFO)
  784. AC_DEFUN(AC_REVISION,
  785. [AC_REQUIRE([AC_INIT_BINSH])dnl
  786. [# From configure.in] translit([$1], $")])
  787.  
  788. dnl Subroutines of AC_PREREQ.
  789.  
  790. dnl Change the dots in NUMBER into commas.
  791. dnl AC_PREREQ_SPLIT(NUMBER)
  792. define(AC_PREREQ_SPLIT,
  793. [translit($1, ., [, ])])
  794.  
  795. dnl Default the ternary version number to 0 (e.g., 1, 7 -> 1, 7, 0).
  796. dnl AC_PREREQ_CANON(MAJOR, MINOR [,TERNARY])
  797. define(AC_PREREQ_CANON,
  798. [$1, $2, ifelse([$3], , 0, [$3])])
  799.  
  800. dnl Complain and exit if version number 1 is less than version number 2.
  801. dnl PRINTABLE2 is the printable version of version number 2.
  802. dnl AC_PREREQ_COMPARE(MAJOR1, MINOR1, TERNARY1, MAJOR2, MINOR2, TERNARY2,
  803. dnl                   PRINTABLE2)
  804. define(AC_PREREQ_COMPARE,
  805. [ifelse(builtin([eval],
  806. [$3 + $2 * 1000 + $1 * 1000000 < $6 + $5 * 1000 + $4 * 1000000]), 1,
  807. [errprint(Autoconf version $7 or higher is required for this script
  808. )m4exit(3)])])
  809.  
  810. dnl Complain and exit if the Autoconf version is less than VERSION.
  811. dnl AC_PREREQ(VERSION)
  812. define(AC_PREREQ,
  813. [AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
  814. AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])])
  815.  
  816.  
  817. dnl ### Getting the canonical system type
  818.  
  819.  
  820. dnl Find install-sh, config.sub, config.guess, and Cygnus configure
  821. dnl in directory DIR.  These are auxiliary files used in configuration.
  822. dnl DIR can be either absolute or relative to $srcdir.
  823. dnl AC_CONFIG_AUX_DIR(DIR)
  824. AC_DEFUN(AC_CONFIG_AUX_DIR,
  825. [AC_CONFIG_AUX_DIRS($1 $srcdir/$1)])
  826.  
  827. dnl The default is `$srcdir' or `$srcdir/..' or `$srcdir/../..'.
  828. dnl There's no need to call this macro explicitly; just AC_REQUIRE it.
  829. AC_DEFUN(AC_CONFIG_AUX_DIR_DEFAULT,
  830. [AC_CONFIG_AUX_DIRS($srcdir $srcdir/.. $srcdir/../..)])
  831.  
  832. dnl Internal subroutine.
  833. dnl Search for the configuration auxiliary files in directory list $1.
  834. dnl We look only for install-sh, so users of AC_PROG_INSTALL
  835. dnl do not automatically need to distribute the other auxiliary files.
  836. dnl AC_CONFIG_AUX_DIRS(DIR ...)
  837. AC_DEFUN(AC_CONFIG_AUX_DIRS,
  838. [ac_aux_dir=
  839. for ac_dir in $1; do
  840.   if test -f $ac_dir/install-sh; then
  841.     ac_aux_dir=$ac_dir
  842.     ac_install_sh="$ac_aux_dir/install-sh -c"
  843.     break
  844.   elif test -f $ac_dir/install.sh; then
  845.     ac_aux_dir=$ac_dir
  846.     ac_install_sh="$ac_aux_dir/install.sh -c"
  847.     break
  848.   fi
  849. done
  850. if test -z "$ac_aux_dir"; then
  851.   AC_MSG_ERROR([can not find install-sh or install.sh in $1])
  852. fi
  853. ac_config_guess=$ac_aux_dir/config.guess
  854. ac_config_sub=$ac_aux_dir/config.sub
  855. ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
  856. AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  857. ])
  858.  
  859. dnl Canonicalize the host, target, and build system types.
  860. AC_DEFUN(AC_CANONICAL_SYSTEM,
  861. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  862. AC_BEFORE([$0], [AC_ARG_PROGRAM])
  863. # Do some error checking and defaulting for the host and target type.
  864. # The inputs are:
  865. #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
  866. #
  867. # The rules are:
  868. # 1. You are not allowed to specify --host, --target, and nonopt at the
  869. #    same time.
  870. # 2. Host defaults to nonopt.
  871. # 3. If nonopt is not specified, then host defaults to the current host,
  872. #    as determined by config.guess.
  873. # 4. Target and build default to nonopt.
  874. # 5. If nonopt is not specified, then target and build default to host.
  875.  
  876. # The aliases save the names the user supplied, while $host etc.
  877. # will get canonicalized.
  878. case $host---$target---$nonopt in
  879. NONE---*---* | *---NONE---* | *---*---NONE) ;;
  880. *) AC_MSG_ERROR(can only configure for one host and one target at a time) ;;
  881. esac
  882.  
  883. AC_CANONICAL_HOST
  884. AC_CANONICAL_TARGET
  885. AC_CANONICAL_BUILD
  886. test "$host_alias" != "$target_alias" &&
  887.   test "$program_prefix$program_suffix$program_transform_name" = \
  888.     NONENONEs,x,x, &&
  889.   program_prefix=${target_alias}-
  890. ])
  891.  
  892. dnl Subroutines of AC_CANONICAL_SYSTEM.
  893.  
  894. AC_DEFUN(AC_CANONICAL_HOST,
  895. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  896.  
  897. # Make sure we can run config.sub.
  898. if $ac_config_sub sun4 >/dev/null 2>&1; then :
  899. else AC_MSG_ERROR(can not run $ac_config_sub)
  900. fi
  901.  
  902. AC_MSG_CHECKING(host system type)
  903.  
  904. dnl Set host_alias.
  905. host_alias=$host
  906. case "$host_alias" in
  907. NONE)
  908.   case $nonopt in
  909.   NONE)
  910.     if host_alias=`$ac_config_guess`; then :
  911.     else AC_MSG_ERROR(can not guess host type; you must specify one)
  912.     fi ;;
  913.   *) host_alias=$nonopt ;;
  914.   esac ;;
  915. esac
  916.  
  917. dnl Set the other host vars.
  918. host=`$ac_config_sub $host_alias`
  919. host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  920. host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  921. host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  922. AC_MSG_RESULT($host)
  923. AC_SUBST(host)dnl
  924. AC_SUBST(host_alias)dnl
  925. AC_SUBST(host_cpu)dnl
  926. AC_SUBST(host_vendor)dnl
  927. AC_SUBST(host_os)dnl
  928. ])
  929.  
  930. dnl Internal use only.
  931. AC_DEFUN(AC_CANONICAL_TARGET,
  932. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  933. AC_MSG_CHECKING(target system type)
  934.  
  935. dnl Set target_alias.
  936. target_alias=$target
  937. case "$target_alias" in
  938. NONE)
  939.   case $nonopt in
  940.   NONE) target_alias=$host_alias ;;
  941.   *) target_alias=$nonopt ;;
  942.   esac ;;
  943. esac
  944.  
  945. dnl Set the other target vars.
  946. target=`$ac_config_sub $target_alias`
  947. target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  948. target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  949. target_os=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  950. AC_MSG_RESULT($target)
  951. AC_SUBST(target)dnl
  952. AC_SUBST(target_alias)dnl
  953. AC_SUBST(target_cpu)dnl
  954. AC_SUBST(target_vendor)dnl
  955. AC_SUBST(target_os)dnl
  956. ])
  957.  
  958. dnl Internal use only.
  959. AC_DEFUN(AC_CANONICAL_BUILD,
  960. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  961. AC_MSG_CHECKING(build system type)
  962.  
  963. dnl Set build_alias.
  964. build_alias=$build
  965. case "$build_alias" in
  966. NONE)
  967.   case $nonopt in
  968.   NONE) build_alias=$host_alias ;;
  969.   *) build_alias=$nonopt ;;
  970.   esac ;;
  971. esac
  972.  
  973. dnl Set the other build vars.
  974. build=`$ac_config_sub $build_alias`
  975. build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
  976. build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
  977. build_os=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
  978. AC_MSG_RESULT($build)
  979. AC_SUBST(build)dnl
  980. AC_SUBST(build_alias)dnl
  981. AC_SUBST(build_cpu)dnl
  982. AC_SUBST(build_vendor)dnl
  983. AC_SUBST(build_os)dnl
  984. ])
  985.  
  986.  
  987. dnl ### Caching test results
  988.  
  989.  
  990. dnl Look for site or system specific initialization scripts.
  991. dnl AC_SITE_LOAD()
  992. define(AC_SITE_LOAD,
  993. [# Prefer explicitly selected file to automatically selected ones.
  994. if test -z "$CONFIG_SITE"; then
  995.   if test "x$prefix" != xNONE; then
  996.     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  997.   else
  998.     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  999.   fi
  1000. fi
  1001. for ac_site_file in $CONFIG_SITE; do
  1002.   if test -r "$ac_site_file"; then
  1003.     echo "loading site script $ac_site_file"
  1004.     . "$ac_site_file"
  1005.   fi
  1006. done
  1007. ])
  1008.  
  1009. dnl AC_CACHE_LOAD()
  1010. define(AC_CACHE_LOAD,
  1011. [if test -r "$cache_file"; then
  1012.   echo "loading cache $cache_file"
  1013.   . $cache_file
  1014. else
  1015.   echo "creating cache $cache_file"
  1016.   > $cache_file
  1017. fi
  1018. ])
  1019.  
  1020. dnl AC_CACHE_SAVE()
  1021. define(AC_CACHE_SAVE,
  1022. [cat > confcache <<\EOF
  1023. # This file is a shell script that caches the results of configure
  1024. # tests run on this system so they can be shared between configure
  1025. # scripts and configure runs.  It is not useful on other systems.
  1026. # If it contains results you don't want to keep, you may remove or edit it.
  1027. #
  1028. # By default, configure uses ./config.cache as the cache file,
  1029. # creating it if it does not exist already.  You can give configure
  1030. # the --cache-file=FILE option to use a different cache file; that is
  1031. # what configure does when it calls configure scripts in
  1032. # subdirectories, so they share the cache.
  1033. # Giving --cache-file=/dev/null disables caching, for debugging configure.
  1034. # config.status only pays attention to the cache file if you give it the
  1035. # --recheck option to rerun configure.
  1036. #
  1037. EOF
  1038. changequote(, )dnl
  1039. dnl Allow a site initialization script to override cache values.
  1040. # Ultrix sh set writes to stderr and can't be redirected directly,
  1041. # and sets the high bit in the cache file unless we assign to the vars.
  1042. (set) 2>&1 |
  1043.   sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
  1044.   >> confcache
  1045. changequote([, ])dnl
  1046. if cmp -s $cache_file confcache; then
  1047.   :
  1048. else
  1049.   if test -w $cache_file; then
  1050.     echo "updating cache $cache_file"
  1051.     cat confcache > $cache_file
  1052.   else
  1053.     echo "not updating unwritable cache $cache_file"
  1054.   fi
  1055. fi
  1056. rm -f confcache
  1057. ])
  1058.  
  1059. dnl The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
  1060. dnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
  1061. define(AC_CACHE_VAL,
  1062. [dnl We used to use the below line, but it fails if the 1st arg is a
  1063. dnl shell variable, so we need the eval.
  1064. dnl if test "${$1+set}" = set; then
  1065. dnl the '' avoids an AIX 4.1 sh bug ("invalid expansion").
  1066. if eval "test \"`echo '$''{'$1'+set}'`\" = set"; then
  1067.   echo $ac_n "(cached) $ac_c" 1>&AC_FD_MSG
  1068. else
  1069.   $2
  1070. fi
  1071. ])
  1072.  
  1073. dnl AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS)
  1074. define(AC_CACHE_CHECK,
  1075. [AC_MSG_CHECKING([$1])
  1076. AC_CACHE_VAL([$2], [$3])
  1077. AC_MSG_RESULT([$]$2)])
  1078.  
  1079.  
  1080. dnl ### Defining symbols
  1081.  
  1082.  
  1083. dnl Set VARIABLE to VALUE, verbatim, or 1.
  1084. dnl AC_DEFINE(VARIABLE [, VALUE])
  1085. define(AC_DEFINE,
  1086. [cat >> confdefs.h <<\EOF
  1087. [#define] $1 ifelse($#, 2, [$2], 1)
  1088. EOF
  1089. ])
  1090.  
  1091. dnl Similar, but perform shell substitutions $ ` \ once on VALUE.
  1092. define(AC_DEFINE_UNQUOTED,
  1093. [cat >> confdefs.h <<EOF
  1094. [#define] $1 ifelse($#, 2, [$2], 1)
  1095. EOF
  1096. ])
  1097.  
  1098.  
  1099. dnl ### Setting output variables
  1100.  
  1101.  
  1102. dnl This macro protects VARIABLE from being diverted twice
  1103. dnl if this macro is called twice for it.
  1104. dnl AC_SUBST(VARIABLE)
  1105. define(AC_SUBST,
  1106. [ifdef([AC_SUBST_$1], ,
  1107. [define([AC_SUBST_$1], )dnl
  1108. AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
  1109. s%@$1@%[$]$1%g
  1110. AC_DIVERT_POP()dnl
  1111. ])])
  1112.  
  1113. dnl AC_SUBST_FILE(VARIABLE)
  1114. define(AC_SUBST_FILE,
  1115. [ifdef([AC_SUBST_$1], ,
  1116. [define([AC_SUBST_$1], )dnl
  1117. AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
  1118. /@$1@/r [$]$1
  1119. s%@$1@%%g
  1120. AC_DIVERT_POP()dnl
  1121. ])])
  1122.  
  1123.  
  1124. dnl ### Printing messages
  1125.  
  1126.  
  1127. dnl AC_MSG_CHECKING(FEATURE-DESCRIPTION)
  1128. define(AC_MSG_CHECKING,
  1129. [echo $ac_n "checking $1""... $ac_c" 1>&AC_FD_MSG])
  1130.  
  1131. dnl AC_CHECKING(FEATURE-DESCRIPTION)
  1132. define(AC_CHECKING,
  1133. [echo "checking $1" 1>&AC_FD_MSG])
  1134.  
  1135. dnl AC_MSG_RESULT(RESULT-DESCRIPTION)
  1136. define(AC_MSG_RESULT,
  1137. [echo "$ac_t""$1" 1>&AC_FD_MSG])
  1138.  
  1139. dnl AC_VERBOSE(RESULT-DESCRIPTION)
  1140. define(AC_VERBOSE,
  1141. [AC_OBSOLETE([$0], [; instead use AC_MSG_RESULT])dnl
  1142. echo "    $1" 1>&AC_FD_MSG])
  1143.  
  1144. dnl AC_MSG_WARN(PROBLEM-DESCRIPTION)
  1145. define(AC_MSG_WARN,
  1146. [echo "configure: warning: $1" 1>&2])
  1147.  
  1148. dnl AC_MSG_ERROR(ERROR-DESCRIPTION)
  1149. define(AC_MSG_ERROR,
  1150. [{ echo "configure: error: $1" 1>&2; exit 1; }])
  1151.  
  1152.  
  1153. dnl ### Selecting which language to use for testing
  1154.  
  1155.  
  1156. dnl AC_LANG_C()
  1157. AC_DEFUN(AC_LANG_C,
  1158. [define([AC_LANG], [C])dnl
  1159. ac_ext=c
  1160. # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  1161. ac_cpp='$CPP $CPPFLAGS'
  1162. ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC'
  1163. ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
  1164. ])
  1165.  
  1166. dnl AC_LANG_CPLUSPLUS()
  1167. AC_DEFUN(AC_LANG_CPLUSPLUS,
  1168. [define([AC_LANG], [CPLUSPLUS])dnl
  1169. ac_ext=C
  1170. # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  1171. ac_cpp='$CXXCPP $CPPFLAGS'
  1172. ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC'
  1173. ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
  1174. ])
  1175.  
  1176. dnl Push the current language on a stack.
  1177. dnl AC_LANG_SAVE()
  1178. define(AC_LANG_SAVE,
  1179. [pushdef([AC_LANG_STACK], AC_LANG)])
  1180.  
  1181. dnl Restore the current language from the stack.
  1182. dnl AC_LANG_RESTORE()
  1183. define(AC_LANG_RESTORE,
  1184. [ifelse(AC_LANG_STACK, C, [ifelse(AC_LANG, C, , [AC_LANG_C])], [ifelse(AC_LANG, CPLUSPLUS, , [AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])])
  1185.  
  1186.  
  1187. dnl ### Compiler-running mechanics
  1188.  
  1189.  
  1190. dnl The purpose of this macro is to "configure:123: command line"
  1191. dnl written into config.log for every test run.
  1192. dnl AC_TRY_EVAL(VARIABLE)
  1193. AC_DEFUN(AC_TRY_EVAL,
  1194. [{ (eval echo configure:__oline__: \"[$]$1\") 1>&AC_FD_CC; dnl
  1195. (eval [$]$1) 2>&AC_FD_CC; }])
  1196.  
  1197. dnl AC_TRY_COMMAND(COMMAND)
  1198. AC_DEFUN(AC_TRY_COMMAND,
  1199. [{ ac_try='$1'; AC_TRY_EVAL(ac_try); }])
  1200.  
  1201.  
  1202. dnl ### Dependencies between macros
  1203.  
  1204.  
  1205. dnl AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)
  1206. define(AC_BEFORE,
  1207. [ifdef([AC_PROVIDE_$2], [errprint(__file__:__line__: [$2 was called before $1
  1208. ])])])
  1209.  
  1210. dnl AC_REQUIRE(MACRO-NAME)
  1211. define(AC_REQUIRE,
  1212. [ifdef([AC_PROVIDE_$1], ,
  1213. [AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl
  1214. indir([$1])
  1215. AC_DIVERT_POP()dnl
  1216. ])])
  1217.  
  1218. dnl AC_PROVIDE(MACRO-NAME)
  1219. define(AC_PROVIDE,
  1220. [define([AC_PROVIDE_$1], )])
  1221.  
  1222. dnl AC_OBSOLETE(THIS-MACRO-NAME [, SUGGESTION])
  1223. define(AC_OBSOLETE,
  1224. [errprint(__file__:__line__: warning: [$1] is obsolete[$2]
  1225. )])
  1226.  
  1227.  
  1228. dnl ### Checking for programs
  1229.  
  1230.  
  1231. dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
  1232. dnl               [, [VALUE-IF-NOT-FOUND] [, [PATH] [, [REJECT]]]])
  1233. AC_DEFUN(AC_CHECK_PROG,
  1234. [# Extract the first word of "$2", so it can be a program name with args.
  1235. set dummy $2; ac_word=[$]2
  1236. AC_MSG_CHECKING([for $ac_word])
  1237. AC_CACHE_VAL(ac_cv_prog_$1,
  1238. [if test -n "[$]$1"; then
  1239.   ac_cv_prog_$1="[$]$1" # Let the user override the test.
  1240. else
  1241.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  1242. ifelse([$6], , , [  ac_prog_rejected=no
  1243. ])dnl
  1244.   for ac_dir in ifelse([$5], , $PATH, [$5]); do
  1245.     test -z "$ac_dir" && ac_dir=.
  1246.     if test -f $ac_dir/$ac_word; then
  1247. ifelse([$6], , , dnl
  1248. [      if test "[$ac_dir/$ac_word]" = "$6"; then
  1249.         ac_prog_rejected=yes
  1250.     continue
  1251.       fi
  1252. ])dnl
  1253.       ac_cv_prog_$1="$3"
  1254.       break
  1255.     fi
  1256.   done
  1257.   IFS="$ac_save_ifs"
  1258. ifelse([$6], , , [if test $ac_prog_rejected = yes; then
  1259.   # We found a bogon in the path, so make sure we never use it.
  1260.   set dummy [$]ac_cv_prog_$1
  1261.   shift
  1262.   if test [$]# -gt 0; then
  1263.     # We chose a different compiler from the bogus one.
  1264.     # However, it has the same basename, so the bogon will be chosen
  1265.     # first if we set $1 to just the basename; use the full file name.
  1266.     shift
  1267.     set dummy "$ac_dir/$ac_word" "[$]@"
  1268.     shift
  1269.     ac_cv_prog_$1="[$]@"
  1270. ifelse([$2], [$4], dnl
  1271. [  else
  1272.     # Default is a loser.
  1273.     AC_MSG_ERROR([$1=$6 unacceptable, but no other $4 found in dnl
  1274. ifelse([$5], , [\$]PATH, [$5])])
  1275. ])dnl
  1276.   fi
  1277. fi
  1278. ])dnl
  1279. dnl If no 4th arg is given, leave the cache variable unset,
  1280. dnl so AC_CHECK_PROGS will keep looking.
  1281. ifelse([$4], , , [  test -z "[$]ac_cv_prog_$1" && ac_cv_prog_$1="$4"
  1282. ])dnl
  1283. fi])dnl
  1284. $1="$ac_cv_prog_$1"
  1285. if test -n "[$]$1"; then
  1286.   AC_MSG_RESULT([$]$1)
  1287. else
  1288.   AC_MSG_RESULT(no)
  1289. fi
  1290. AC_SUBST($1)dnl
  1291. ])
  1292.  
  1293. dnl AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND [, PATH]])
  1294. AC_DEFUN(AC_PATH_PROG,
  1295. [# Extract the first word of "$2", so it can be a program name with args.
  1296. set dummy $2; ac_word=[$]2
  1297. AC_MSG_CHECKING([for $ac_word])
  1298. AC_CACHE_VAL(ac_cv_path_$1,
  1299. [case "[$]$1" in
  1300.   /*)
  1301.   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  1302.   ;;
  1303.   *)
  1304.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  1305.   for ac_dir in ifelse([$4], , $PATH, [$4]); do
  1306.     test -z "$ac_dir" && ac_dir=.
  1307.     if test -f $ac_dir/$ac_word; then
  1308.       ac_cv_path_$1="$ac_dir/$ac_word"
  1309.       break
  1310.     fi
  1311.   done
  1312.   IFS="$ac_save_ifs"
  1313. dnl If no 3rd arg is given, leave the cache variable unset,
  1314. dnl so AC_PATH_PROGS will keep looking.
  1315. ifelse([$3], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$3"
  1316. ])dnl
  1317.   ;;
  1318. esac])dnl
  1319. $1="$ac_cv_path_$1"
  1320. if test -n "[$]$1"; then
  1321.   AC_MSG_RESULT([$]$1)
  1322. else
  1323.   AC_MSG_RESULT(no)
  1324. fi
  1325. AC_SUBST($1)dnl
  1326. ])
  1327.  
  1328. dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
  1329. dnl                [, PATH]])
  1330. AC_DEFUN(AC_CHECK_PROGS,
  1331. [for ac_prog in $2
  1332. do
  1333. AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, , $4)
  1334. test -n "[$]$1" && break
  1335. done
  1336. ifelse([$3], , , [test -n "[$]$1" || $1="$3"
  1337. ])])
  1338.  
  1339. dnl AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND
  1340. dnl               [, PATH]])
  1341. AC_DEFUN(AC_PATH_PROGS,
  1342. [for ac_prog in $2
  1343. do
  1344. AC_PATH_PROG($1, [$]ac_prog, , $4)
  1345. test -n "[$]$1" && break
  1346. done
  1347. ifelse([$3], , , [test -n "[$]$1" || $1="$3"
  1348. ])])
  1349.  
  1350. dnl Internal subroutine.
  1351. AC_DEFUN(AC_CHECK_TOOL_PREFIX,
  1352. [AC_REQUIRE([AC_CANONICAL_HOST])AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  1353. if test $host != $build; then
  1354.   ac_tool_prefix=${host_alias}-
  1355. else
  1356.   ac_tool_prefix=
  1357. fi
  1358. ])
  1359.  
  1360. dnl AC_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]])
  1361. AC_DEFUN(AC_CHECK_TOOL,
  1362. [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
  1363. AC_CHECK_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2,
  1364.           ifelse([$3], , [$2], ), $4)
  1365. ifelse([$3], , , [
  1366. if test -z "$ac_cv_prog_$1"; then
  1367. if test -n "$ac_tool_prefix"; then
  1368.   AC_CHECK_PROG($1, $2, $2, $3)
  1369. else
  1370.   $1="$3"
  1371. fi
  1372. fi])
  1373. ])
  1374.  
  1375. dnl Guess the value for the `prefix' variable by looking for
  1376. dnl the argument program along PATH and taking its parent.
  1377. dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc,
  1378. dnl set `prefix' to /usr/local/gnu.
  1379. dnl This comes too late to find a site file based on the prefix,
  1380. dnl and it might use a cached value for the path.
  1381. dnl No big loss, I think, since most configures don't use this macro anyway.
  1382. dnl AC_PREFIX_PROGRAM(PROGRAM)
  1383. AC_DEFUN(AC_PREFIX_PROGRAM,
  1384. [if test "x$prefix" = xNONE; then
  1385. changequote(<<, >>)dnl
  1386. define(<<AC_VAR_NAME>>, translit($1, [a-z], [A-Z]))dnl
  1387. changequote([, ])dnl
  1388. AC_MSG_CHECKING([for prefix by ])
  1389. AC_PATH_PROG(AC_VAR_NAME, $1)
  1390. changequote(<<, >>)dnl
  1391.   if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then
  1392.     prefix=`echo $ac_cv_path_<<>>AC_VAR_NAME|sed 's%/[^/][^/]*//*[^/][^/]*$%%'`
  1393. changequote([, ])dnl
  1394.   fi
  1395. fi
  1396. undefine([AC_VAR_NAME])dnl
  1397. ])
  1398.  
  1399.  
  1400. dnl ### Checking for libraries
  1401.  
  1402.  
  1403. dnl AC_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
  1404. dnl              [, OTHER-LIBRARIES]]])
  1405. AC_DEFUN(AC_CHECK_LIB,
  1406. [AC_MSG_CHECKING([for -l$1])
  1407. dnl Use a cache variable name containing both the library and function name,
  1408. dnl because the test really is for library $1 defining function $2, not
  1409. dnl just for library $1.  Separate tests with the same $1 and different $2s
  1410. dnl may have different results.
  1411. ac_lib_var=`echo $1['_']$2 | tr './+\055' '__p_'`
  1412. AC_CACHE_VAL(ac_cv_lib_$ac_lib_var,
  1413. [ac_save_LIBS="$LIBS"
  1414. LIBS="-l$1 $5 $LIBS"
  1415. AC_TRY_LINK(dnl
  1416. ifelse([$2], [main], , dnl Avoid conflicting decl of main.
  1417. [/* Override any gcc2 internal prototype to avoid an error.  */
  1418. ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
  1419. extern "C"
  1420. #endif
  1421. ])dnl
  1422. [/* We use char because int might match the return type of a gcc2
  1423.     builtin and then its argument prototype would still apply.  */
  1424. char $2();
  1425. ]),
  1426.         [$2()],
  1427.         eval "ac_cv_lib_$ac_lib_var=yes",
  1428.         eval "ac_cv_lib_$ac_lib_var=no")dnl
  1429. LIBS="$ac_save_LIBS"
  1430. ])dnl
  1431. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  1432.   AC_MSG_RESULT(yes)
  1433.   ifelse([$3], ,
  1434. [changequote(, )dnl
  1435.   ac_tr_lib=HAVE_LIB`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  1436. changequote([, ])dnl
  1437.   AC_DEFINE_UNQUOTED($ac_tr_lib)
  1438.   LIBS="-l$1 $LIBS"
  1439. ], [$3])
  1440. else
  1441.   AC_MSG_RESULT(no)
  1442. ifelse([$4], , , [$4
  1443. ])dnl
  1444. fi
  1445. ])
  1446.  
  1447. dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
  1448. dnl                 [, OTHER-LIBRARIES]]])
  1449. AC_DEFUN(AC_HAVE_LIBRARY,
  1450. [AC_OBSOLETE([$0], [; instead use AC_CHECK_LIB])dnl
  1451. changequote(<<, >>)dnl
  1452. define(<<AC_LIB_NAME>>, dnl
  1453. patsubst(patsubst($1, <<lib\([^\.]*\)\.a>>, <<\1>>), <<-l>>, <<>>))dnl
  1454. define(<<AC_CV_NAME>>, ac_cv_lib_<<>>AC_LIB_NAME)dnl
  1455. changequote([, ])dnl
  1456. AC_MSG_CHECKING([for -l[]AC_LIB_NAME])
  1457. AC_CACHE_VAL(AC_CV_NAME,
  1458. [ac_save_LIBS="$LIBS"
  1459. LIBS="-l[]AC_LIB_NAME[] $4 $LIBS"
  1460. AC_TRY_LINK( , [main()], AC_CV_NAME=yes, AC_CV_NAME=no)dnl
  1461. LIBS="$ac_save_LIBS"
  1462. ])dnl
  1463. AC_MSG_RESULT($AC_CV_NAME)
  1464. if test "$AC_CV_NAME" = yes; then
  1465.   ifelse([$2], ,
  1466. [AC_DEFINE([HAVE_LIB]translit(AC_LIB_NAME, [a-z], [A-Z]))
  1467.   LIBS="-l[]AC_LIB_NAME[] $LIBS"
  1468. ], [$2])
  1469. ifelse([$3], , , [else
  1470.   $3
  1471. ])dnl
  1472. fi
  1473. undefine([AC_LIB_NAME])dnl
  1474. undefine([AC_CV_NAME])dnl
  1475. ])
  1476.  
  1477.  
  1478. dnl ### Examining declarations
  1479.  
  1480.  
  1481. dnl AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE [, ACTION-IF-FALSE]])
  1482. AC_DEFUN(AC_TRY_CPP,
  1483. [AC_REQUIRE_CPP()dnl
  1484. cat > conftest.$ac_ext <<EOF
  1485. [#]line __oline__ "configure"
  1486. #include "confdefs.h"
  1487. [$1]
  1488. EOF
  1489. dnl Capture the stderr of cpp.  eval is necessary to expand ac_cpp.
  1490. dnl We used to copy stderr to stdout and capture it in a variable, but
  1491. dnl that breaks under sh -x, which writes compile commands starting
  1492. dnl with ` +' to stderr in eval and subshells.
  1493. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  1494. AC_TRY_EVAL(ac_try)
  1495. ac_err=`grep -v '^ *+' conftest.out`
  1496. if test -z "$ac_err"; then
  1497.   ifelse([$2], , :, [rm -rf conftest*
  1498.   $2])
  1499. else
  1500.   echo "$ac_err" >&AC_FD_CC
  1501. ifelse([$3], , , [  rm -rf conftest*
  1502.   $3
  1503. ])dnl
  1504. fi
  1505. rm -f conftest*])
  1506.  
  1507. dnl AC_EGREP_HEADER(PATTERN, HEADER-FILE, ACTION-IF-FOUND [,
  1508. dnl                 ACTION-IF-NOT-FOUND])
  1509. AC_DEFUN(AC_EGREP_HEADER,
  1510. [AC_EGREP_CPP([$1], [#include <$2>], [$3], [$4])])
  1511.  
  1512. dnl Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must
  1513. dnl come early, it is not included in AC_BEFORE checks.
  1514. dnl AC_EGREP_CPP(PATTERN, PROGRAM, [ACTION-IF-FOUND [,
  1515. dnl              ACTION-IF-NOT-FOUND]])
  1516. AC_DEFUN(AC_EGREP_CPP,
  1517. [AC_REQUIRE_CPP()dnl
  1518. cat > conftest.$ac_ext <<EOF
  1519. [#]line __oline__ "configure"
  1520. #include "confdefs.h"
  1521. [$2]
  1522. EOF
  1523. dnl eval is necessary to expand ac_cpp.
  1524. dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
  1525. if (eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC |
  1526.   egrep "$1" >/dev/null 2>&1; then
  1527.   ifelse([$3], , :, [rm -rf conftest*
  1528.   $3])
  1529. ifelse([$4], , , [else
  1530.   rm -rf conftest*
  1531.   $4
  1532. ])dnl
  1533. fi
  1534. rm -f conftest*
  1535. ])
  1536.  
  1537.  
  1538. dnl ### Examining syntax
  1539.  
  1540.  
  1541. dnl AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY,
  1542. dnl             [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  1543. AC_DEFUN(AC_TRY_COMPILE,
  1544. [cat > conftest.$ac_ext <<EOF
  1545. dnl This sometimes fails to find confdefs.h, for some reason.
  1546. dnl [#]line __oline__ "[$]0"
  1547. [#]line __oline__ "configure"
  1548. #include "confdefs.h"
  1549. [$1]
  1550. int main() { return 0; }
  1551. int t() {
  1552. [$2]
  1553. ; return 0; }
  1554. EOF
  1555. if AC_TRY_EVAL(ac_compile); then
  1556.   ifelse([$3], , :, [rm -rf conftest*
  1557.   $3])
  1558. ifelse([$4], , , [else
  1559.   rm -rf conftest*
  1560.   $4
  1561. ])dnl
  1562. fi
  1563. rm -f conftest*]
  1564. )
  1565.  
  1566.  
  1567. dnl ### Examining libraries
  1568.  
  1569.  
  1570. dnl AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
  1571. dnl                  ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
  1572. AC_DEFUN(AC_COMPILE_CHECK,
  1573. [AC_OBSOLETE([$0], [; instead use AC_TRY_COMPILE or AC_TRY_LINK, and AC_MSG_CHECKING and AC_MSG_RESULT])dnl
  1574. ifelse([$1], , , [AC_CHECKING([for $1])
  1575. ])dnl
  1576. AC_TRY_LINK([$2], [$3], [$4], [$5])dnl
  1577. ])
  1578.  
  1579. dnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
  1580. dnl             [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  1581. AC_DEFUN(AC_TRY_LINK,
  1582. [cat > conftest.$ac_ext <<EOF
  1583. dnl This sometimes fails to find confdefs.h, for some reason.
  1584. dnl [#]line __oline__ "[$]0"
  1585. [#]line __oline__ "configure"
  1586. #include "confdefs.h"
  1587. [$1]
  1588. int main() { return 0; }
  1589. int t() {
  1590. [$2]
  1591. ; return 0; }
  1592. EOF
  1593. if AC_TRY_EVAL(ac_link); then
  1594.   ifelse([$3], , :, [rm -rf conftest*
  1595.   $3])
  1596. ifelse([$4], , , [else
  1597.   rm -rf conftest*
  1598.   $4
  1599. ])dnl
  1600. fi
  1601. rm -f conftest*]
  1602. )
  1603.  
  1604.  
  1605. dnl ### Checking for run-time features
  1606.  
  1607.  
  1608. dnl AC_TRY_RUN(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE
  1609. dnl            [, ACTION-IF-CROSS-COMPILING]]])
  1610. AC_DEFUN(AC_TRY_RUN,
  1611. [AC_REQUIRE([AC_C_CROSS])dnl
  1612. if test "$cross_compiling" = yes; then
  1613.   ifelse([$4], ,
  1614.     [errprint(__file__:__line__: warning: [AC_TRY_RUN] called without default to allow cross compiling
  1615. )dnl
  1616.   AC_MSG_ERROR(can not run test program while cross compiling)],
  1617.   [$4])
  1618. else
  1619. cat > conftest.$ac_ext <<EOF
  1620. [#]line __oline__ "configure"
  1621. #include "confdefs.h"
  1622. ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
  1623. extern "C" void exit(int);
  1624. #endif
  1625. ])dnl
  1626. [$1]
  1627. EOF
  1628. AC_TRY_EVAL(ac_link)
  1629. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1630.   ifelse([$2], , :, [$2])
  1631. ifelse([$3], , , [else
  1632.   $3
  1633. ])dnl
  1634. fi
  1635. fi
  1636. rm -fr conftest*])
  1637.  
  1638.  
  1639. dnl ### Checking for header files
  1640.  
  1641.  
  1642. dnl AC_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  1643. AC_DEFUN(AC_CHECK_HEADER,
  1644. [dnl Do the transliteration at runtime so arg 1 can be a shell variable.
  1645. ac_safe=`echo "$1" | tr './\055' '___'`
  1646. AC_MSG_CHECKING([for $1])
  1647. AC_CACHE_VAL(ac_cv_header_$ac_safe,
  1648. [AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes",
  1649.   eval "ac_cv_header_$ac_safe=no")])dnl
  1650. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  1651.   AC_MSG_RESULT(yes)
  1652.   ifelse([$2], , :, [$2])
  1653. else
  1654.   AC_MSG_RESULT(no)
  1655. ifelse([$3], , , [$3
  1656. ])dnl
  1657. fi
  1658. ])
  1659.  
  1660. dnl AC_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  1661. AC_DEFUN(AC_CHECK_HEADERS,
  1662. [for ac_hdr in $1
  1663. do
  1664. AC_CHECK_HEADER($ac_hdr,
  1665. [changequote(, )dnl
  1666.   ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
  1667. changequote([, ])dnl
  1668.   AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3)dnl
  1669. done
  1670. ])
  1671.  
  1672.  
  1673. dnl ### Checking for library functions
  1674.  
  1675.  
  1676. dnl AC_CHECK_FUNC(FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  1677. AC_DEFUN(AC_CHECK_FUNC,
  1678. [AC_MSG_CHECKING([for $1])
  1679. AC_CACHE_VAL(ac_cv_func_$1,
  1680. [AC_TRY_LINK(
  1681. dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h>
  1682. dnl which includes <sys/select.h> which contains a prototype for
  1683. dnl select.  Similarly for bzero.
  1684. [/* System header to define __stub macros and hopefully few prototypes,
  1685.     which can conflict with char $1(); below.  */
  1686. #include <assert.h>
  1687. /* Override any gcc2 internal prototype to avoid an error.  */
  1688. ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
  1689. extern "C"
  1690. #endif
  1691. ])dnl
  1692. [/* We use char because int might match the return type of a gcc2
  1693.     builtin and then its argument prototype would still apply.  */
  1694. char $1();
  1695. ], [
  1696. /* The GNU C library defines this for functions which it implements
  1697.     to always fail with ENOSYS.  Some functions are actually named
  1698.     something starting with __ and the normal name is an alias.  */
  1699. #if defined (__stub_$1) || defined (__stub___$1)
  1700. choke me
  1701. #else
  1702. $1();
  1703. #endif
  1704. ], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])dnl
  1705. if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then
  1706.   AC_MSG_RESULT(yes)
  1707.   ifelse([$2], , :, [$2])
  1708. else
  1709.   AC_MSG_RESULT(no)
  1710. ifelse([$3], , , [$3
  1711. ])dnl
  1712. fi
  1713. ])
  1714.  
  1715. dnl AC_CHECK_FUNCS(FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  1716. AC_DEFUN(AC_CHECK_FUNCS,
  1717. [for ac_func in $1
  1718. do
  1719. AC_CHECK_FUNC($ac_func,
  1720. [changequote(, )dnl
  1721.   ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  1722. changequote([, ])dnl
  1723.   AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl
  1724. done
  1725. ])
  1726.  
  1727. dnl AC_REPLACE_FUNCS(FUNCTION-NAME...)
  1728. AC_DEFUN(AC_REPLACE_FUNCS,
  1729. [for ac_func in $1
  1730. do
  1731. AC_CHECK_FUNC($ac_func, , [LIBOBJS="$LIBOBJS ${ac_func}.o"])
  1732. done
  1733. AC_SUBST(LIBOBJS)dnl
  1734. ])
  1735.  
  1736.  
  1737. dnl ### Checking compiler characteristics
  1738.  
  1739.  
  1740. dnl AC_CHECK_SIZEOF(TYPE [, CROSS-SIZE])
  1741. AC_DEFUN(AC_CHECK_SIZEOF,
  1742. [changequote(<<, >>)dnl
  1743. dnl The name to #define.
  1744. define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
  1745. dnl The cache variable name.
  1746. define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
  1747. changequote([, ])dnl
  1748. AC_MSG_CHECKING(size of $1)
  1749. AC_CACHE_VAL(AC_CV_NAME,
  1750. [AC_TRY_RUN([#include <stdio.h>
  1751. main()
  1752. {
  1753.   FILE *f=fopen("conftestval", "w");
  1754.   if (!f) exit(1);
  1755.   fprintf(f, "%d\n", sizeof($1));
  1756.   exit(0);
  1757. }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl
  1758. AC_MSG_RESULT($AC_CV_NAME)
  1759. AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
  1760. undefine([AC_TYPE_NAME])dnl
  1761. undefine([AC_CV_NAME])dnl
  1762. ])
  1763.  
  1764.  
  1765. dnl ### Checking for typedefs
  1766.  
  1767.  
  1768. dnl AC_CHECK_TYPE(TYPE, DEFAULT)
  1769. AC_DEFUN(AC_CHECK_TYPE,
  1770. [AC_REQUIRE([AC_HEADER_STDC])dnl
  1771. AC_MSG_CHECKING(for $1)
  1772. AC_CACHE_VAL(ac_cv_type_$1,
  1773. [AC_EGREP_CPP($1, [#include <sys/types.h>
  1774. #if STDC_HEADERS
  1775. #include <stdlib.h>
  1776. #endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
  1777. AC_MSG_RESULT($ac_cv_type_$1)
  1778. if test $ac_cv_type_$1 = no; then
  1779.   AC_DEFINE($1, $2)
  1780. fi
  1781. ])
  1782.  
  1783.  
  1784. dnl ### Creating output files
  1785.  
  1786.  
  1787. dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
  1788. AC_DEFUN(AC_CONFIG_HEADER,
  1789. [define(AC_LIST_HEADER, $1)])
  1790.  
  1791. dnl Link each of the existing files SOURCE... to the corresponding
  1792. dnl link name in DEST...
  1793. dnl AC_LINK_FILES(SOURCE..., DEST...)
  1794. AC_DEFUN(AC_LINK_FILES,
  1795. [define([AC_LIST_FILES], [$1])define([AC_LIST_LINKS], [$2])])
  1796.  
  1797. dnl AC_CONFIG_SUBDIRS(DIR ...)
  1798. AC_DEFUN(AC_CONFIG_SUBDIRS,
  1799. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  1800. define([AC_LIST_SUBDIRS], [$1])dnl
  1801. subdirs="AC_LIST_SUBDIRS"
  1802. AC_SUBST(subdirs)dnl
  1803. ])
  1804.  
  1805. dnl The big finish.
  1806. dnl Produce config.status, config.h, and links, and configure subdirs.
  1807. dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS])
  1808. define(AC_OUTPUT,
  1809. [trap '' 1 2 15
  1810. AC_CACHE_SAVE
  1811. trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
  1812.  
  1813. test "x$prefix" = xNONE && prefix=$ac_default_prefix
  1814. # Let make expand exec_prefix.
  1815. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
  1816.  
  1817. # Any assignment to VPATH causes Sun make to only execute
  1818. # the first set of double-colon rules, so remove it if not needed.
  1819. # If there is a colon in the path, we need to keep it.
  1820. if test "x$srcdir" = x.; then
  1821. changequote(, )dnl
  1822.   ac_vpsub='/^[     ]*VPATH[     ]*=[^:]*$/d'
  1823. changequote([, ])dnl
  1824. fi
  1825.  
  1826. trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
  1827.  
  1828. ifdef([AC_LIST_HEADER], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
  1829.  
  1830. # Without the "./", some shells look in PATH for config.status.
  1831. : ${CONFIG_STATUS=./config.status}
  1832.  
  1833. echo creating $CONFIG_STATUS
  1834. rm -f $CONFIG_STATUS
  1835. cat > $CONFIG_STATUS <<EOF
  1836. #! /bin/sh
  1837. # Generated automatically by configure.
  1838. # Run this file to recreate the current configuration.
  1839. # This directory was configured as follows,
  1840. dnl hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
  1841. dnl so uname gets run too.
  1842. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1843. #
  1844. [#] [$]0 [$]ac_configure_args
  1845. #
  1846. # Compiler output produced by configure, useful for debugging
  1847. # configure, is in ./config.log if it exists.
  1848.  
  1849. changequote(, )dnl
  1850. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
  1851. changequote([, ])dnl
  1852. for ac_option
  1853. do
  1854.   case "[\$]ac_option" in
  1855.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1856.     echo "running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion"
  1857.     exec [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion ;;
  1858.   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
  1859.     echo "$CONFIG_STATUS generated by autoconf version AC_ACVERSION"
  1860.     exit 0 ;;
  1861.   -help | --help | --hel | --he | --h)
  1862.     echo "[\$]ac_cs_usage"; exit 0 ;;
  1863.   *) echo "[\$]ac_cs_usage"; exit 1 ;;
  1864.   esac
  1865. done
  1866.  
  1867. ac_given_srcdir=$srcdir
  1868. ifdef([AC_PROVIDE_AC_PROG_INSTALL], [ac_given_INSTALL="$INSTALL"
  1869. ])dnl
  1870.  
  1871. changequote(<<, >>)dnl
  1872. ifdef(<<AC_LIST_HEADER>>,
  1873. <<trap 'rm -fr `echo "$1 AC_LIST_HEADER" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15>>,
  1874. <<trap 'rm -fr `echo "$1" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15>>)
  1875. changequote([, ])dnl
  1876. EOF
  1877. cat >> $CONFIG_STATUS <<EOF
  1878.  
  1879. AC_OUTPUT_FILES($1)
  1880. ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl
  1881. ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_FILES, AC_LIST_LINKS)])dnl
  1882. ifelse([$3], , ,
  1883. [EOF
  1884. cat >> $CONFIG_STATUS <<EOF
  1885. $3
  1886. EOF
  1887. cat >> $CONFIG_STATUS <<\EOF])
  1888. $2
  1889. exit 0
  1890. EOF
  1891. chmod +x $CONFIG_STATUS
  1892. rm -fr confdefs* $ac_clean_files
  1893. test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
  1894. dnl config.status should not do recursion.
  1895. ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl
  1896. ])dnl
  1897.  
  1898. dnl This is a subroutine of AC_OUTPUT.
  1899. dnl It is called inside configure, outside of config.status.
  1900. dnl AC_OUTPUT_MAKE_DEFS()
  1901. define(AC_OUTPUT_MAKE_DEFS,
  1902. [# Transform confdefs.h into DEFS.
  1903. dnl Using a here document instead of a string reduces the quoting nightmare.
  1904. # Protect against shell expansion while executing Makefile rules.
  1905. # Protect against Makefile macro expansion.
  1906. cat > conftest.defs <<\EOF
  1907. changequote(<<, >>)dnl
  1908. s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
  1909. s%[     `~<<#>>$^&*(){}\\|;'"<>?]%\\&%g
  1910. s%\[%\\&%g
  1911. s%\]%\\&%g
  1912. s%\$%$$%g
  1913. changequote([, ])dnl
  1914. EOF
  1915. DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
  1916. rm -f conftest.defs
  1917. ])
  1918.  
  1919. dnl This is a subroutine of AC_OUTPUT.  It is called inside an unquoted
  1920. dnl here document whose contents are going into config.status.
  1921. dnl AC_OUTPUT_FILES(FILE...)
  1922. define(AC_OUTPUT_FILES,
  1923. [# Protect against being on the right side of a sed subst in config.status.
  1924. changequote(, )dnl
  1925. sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
  1926.  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
  1927. changequote([, ])dnl
  1928. dnl These here document variables are unquoted when configure runs
  1929. dnl but quoted when config.status runs, so variables are expanded once.
  1930. $ac_vpsub
  1931. dnl Shell code in configure.in might set extrasub.
  1932. $extrasub
  1933. dnl Insert the sed substitutions of variables.
  1934. undivert(AC_DIVERSION_SED)
  1935. CEOF
  1936. EOF
  1937. cat >> $CONFIG_STATUS <<EOF
  1938.  
  1939. CONFIG_FILES=\${CONFIG_FILES-"$1"}
  1940. EOF
  1941. cat >> $CONFIG_STATUS <<\EOF
  1942. for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  1943. dnl Specifying an input file breaks the trap to clean up on interrupt,
  1944. dnl but that's not a huge problem.
  1945.   # Support "outfile[:infile]", defaulting infile="outfile.in".
  1946.   case "$ac_file" in
  1947.   *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
  1948.        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  1949.   *) ac_file_in="${ac_file}.in" ;;
  1950.   esac
  1951.  
  1952.   # Adjust relative srcdir, etc. for subdirectories.
  1953.  
  1954.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1955. changequote(, )dnl
  1956.   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  1957. changequote([, ])dnl
  1958.   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
  1959.     # The file is in a subdirectory.
  1960.     test ! -d "$ac_dir" && mkdir "$ac_dir"
  1961.     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
  1962.     # A "../" for each directory in $ac_dir_suffix.
  1963. changequote(, )dnl
  1964.     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  1965. changequote([, ])dnl
  1966.   else
  1967.     ac_dir_suffix= ac_dots=
  1968.   fi
  1969.  
  1970.   case "$ac_given_srcdir" in
  1971.   .)  srcdir=.
  1972.       if test -z "$ac_dots"; then top_srcdir=.
  1973.       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
  1974.   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  1975.   *) # Relative path.
  1976.     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
  1977.     top_srcdir="$ac_dots$ac_given_srcdir" ;;
  1978.   esac
  1979.  
  1980. ifdef([AC_PROVIDE_AC_PROG_INSTALL],
  1981. [  case "$ac_given_INSTALL" in
  1982. changequote(, )dnl
  1983.   [/$]*) INSTALL="$ac_given_INSTALL" ;;
  1984. changequote([, ])dnl
  1985.   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
  1986.   esac
  1987. ])dnl
  1988.   echo creating "$ac_file"
  1989.   rm -f "$ac_file"
  1990.   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
  1991.   case "$ac_file" in
  1992.   *Makefile*) ac_comsub="1i\\
  1993. # $configure_input" ;;
  1994.   *) ac_comsub= ;;
  1995.   esac
  1996.   sed -e "$ac_comsub
  1997. s%@configure_input@%$configure_input%g
  1998. s%@srcdir@%$srcdir%g
  1999. s%@top_srcdir@%$top_srcdir%g
  2000. ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g
  2001. ])dnl
  2002. " -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
  2003. dnl This would break Makefile dependencies.
  2004. dnl  if cmp -s $ac_file conftest.out 2>/dev/null; then
  2005. dnl    echo "$ac_file is unchanged"
  2006. dnl    rm -f conftest.out
  2007. dnl   else
  2008. dnl     rm -f $ac_file
  2009. dnl    mv conftest.out $ac_file
  2010. dnl  fi
  2011. fi; done
  2012. rm -f conftest.subs
  2013. ])
  2014.  
  2015. dnl This is a subroutine of AC_OUTPUT.  It is called inside a quoted
  2016. dnl here document whose contents are going into config.status.
  2017. dnl AC_OUTPUT_HEADER(HEADER-FILE...)
  2018. define(AC_OUTPUT_HEADER,
  2019. [changequote(<<, >>)dnl
  2020. # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
  2021. # NAME is the cpp macro being defined and VALUE is the value it is being given.
  2022. #
  2023. # ac_d sets the value in "#define NAME VALUE" lines.
  2024. ac_dA='s%^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  2025. ac_dB='\([     ][     ]*\)[^     ]*%\1#\2'
  2026. ac_dC='\3'
  2027. ac_dD='%g'
  2028. # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  2029. ac_uA='s%^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2030. ac_uB='\([     ]\)%\1#\2define\3'
  2031. ac_uC=' '
  2032. ac_uD='\4%g'
  2033. # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  2034. ac_eA='s%^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2035. ac_eB='<<$>>%\1#\2define\3'
  2036. ac_eC=' '
  2037. ac_eD='%g'
  2038. changequote([, ])dnl
  2039.  
  2040. CONFIG_HEADERS=${CONFIG_HEADERS-"$1"}
  2041. for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  2042.   # Support "outfile[:infile]", defaulting infile="outfile.in".
  2043.   case "$ac_file" in
  2044.   *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
  2045.        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  2046.   *) ac_file_in="${ac_file}.in" ;;
  2047.   esac
  2048.  
  2049.   echo creating $ac_file
  2050.  
  2051.   rm -f conftest.frag conftest.in conftest.out
  2052.   cp $ac_given_srcdir/$ac_file_in conftest.in
  2053.  
  2054. EOF
  2055.  
  2056. # Transform confdefs.h into a sed script conftest.vals that substitutes
  2057. # the proper values into config.h.in to produce config.h.  And first:
  2058. # Protect against being on the right side of a sed subst in config.status.
  2059. # Protect against being in an unquoted here document in config.status.
  2060. rm -f conftest.vals
  2061. dnl Using a here document instead of a string reduces the quoting nightmare.
  2062. dnl Putting comments in sed scripts is not portable.
  2063. cat > conftest.hdr <<\EOF
  2064. changequote(<<, >>)dnl
  2065. s/[\\&%]/\\&/g
  2066. s%[\\$`]%\\&%g
  2067. s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
  2068. s%ac_d%ac_u%gp
  2069. s%ac_u%ac_e%gp
  2070. changequote([, ])dnl
  2071. EOF
  2072. sed -n -f conftest.hdr confdefs.h > conftest.vals
  2073. rm -f conftest.hdr
  2074.  
  2075. # This sed command replaces #undef with comments.  This is necessary, for
  2076. # example, in the case of _POSIX_SOURCE, which is predefined and required
  2077. # on some systems where configure will not decide to define it.
  2078. cat >> conftest.vals <<\EOF
  2079. changequote(, )dnl
  2080. s%^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
  2081. changequote([, ])dnl
  2082. EOF
  2083.  
  2084. # Break up conftest.vals because some shells have a limit on
  2085. # the size of here documents, and old seds have small limits too.
  2086. # Maximum number of lines to put in a single here document.
  2087. ac_max_here_lines=12
  2088.  
  2089. rm -f conftest.tail
  2090. while :
  2091. do
  2092.   ac_lines=`grep -c . conftest.vals`
  2093.   # grep -c gives empty output for an empty file on some AIX systems.
  2094.   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  2095.   # Write a limited-size here document to conftest.frag.
  2096.   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
  2097.   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
  2098.   echo 'CEOF
  2099.   sed -f conftest.frag conftest.in > conftest.out
  2100.   rm -f conftest.in
  2101.   mv conftest.out conftest.in
  2102. ' >> $CONFIG_STATUS
  2103.   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
  2104.   rm -f conftest.vals
  2105.   mv conftest.tail conftest.vals
  2106. done
  2107. rm -f conftest.vals
  2108.  
  2109. dnl Now back to your regularly scheduled config.status.
  2110. cat >> $CONFIG_STATUS <<\EOF
  2111.   rm -f conftest.frag conftest.h
  2112.   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  2113.   cat conftest.in >> conftest.h
  2114.   rm -f conftest.in
  2115.   if cmp -s $ac_file conftest.h 2>/dev/null; then
  2116.     echo "$ac_file is unchanged"
  2117.     rm -f conftest.h
  2118.   else
  2119.     # Remove last slash and all that follows it.  Not all systems have dirname.
  2120.   changequote(, )dnl
  2121.     ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  2122.   changequote([, ])dnl
  2123.     if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
  2124.       # The file is in a subdirectory.
  2125.       test ! -d "$ac_dir" && mkdir "$ac_dir"
  2126.     fi
  2127.     rm -f $ac_file
  2128.     mv conftest.h $ac_file
  2129.   fi
  2130. fi; done
  2131.  
  2132. ])
  2133.  
  2134. dnl This is a subroutine of AC_OUTPUT.  It is called inside a quoted
  2135. dnl here document whose contents are going into config.status.
  2136. dnl AC_OUTPUT_LINKS(SOURCE..., DEST...)
  2137. define(AC_OUTPUT_LINKS,
  2138. [EOF
  2139.  
  2140. cat >> $CONFIG_STATUS <<EOF
  2141. ac_sources="$1"
  2142. ac_dests="$2"
  2143. EOF
  2144.  
  2145. cat >> $CONFIG_STATUS <<\EOF
  2146. srcdir=$ac_given_srcdir
  2147. while test -n "$ac_sources"; do
  2148.   set $ac_dests; ac_dest=[$]1; shift; ac_dests=[$]*
  2149.   set $ac_sources; ac_source=[$]1; shift; ac_sources=[$]*
  2150.  
  2151.   echo "linking $srcdir/$ac_source to $ac_dest"
  2152.  
  2153.   if test ! -r $srcdir/$ac_source; then
  2154.     AC_MSG_ERROR($srcdir/$ac_source: File not found)
  2155.   fi
  2156.   rm -f $ac_dest
  2157.  
  2158.   # Make relative symlinks.
  2159.   # Remove last slash and all that follows it.  Not all systems have dirname.
  2160. changequote(, )dnl
  2161.   ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
  2162. changequote([, ])dnl
  2163.   if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
  2164.     # The dest file is in a subdirectory.
  2165.     test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
  2166.     ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
  2167.     # A "../" for each directory in $ac_dest_dir_suffix.
  2168. changequote(, )dnl
  2169.     ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
  2170. changequote([, ])dnl
  2171.   else
  2172.     ac_dest_dir_suffix= ac_dots=
  2173.   fi
  2174.  
  2175.   case "$srcdir" in
  2176. changequote(, )dnl
  2177.   [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
  2178. changequote([, ])dnl
  2179.   *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
  2180.   esac
  2181.  
  2182.   # Make a symlink if possible; otherwise try a hard link.
  2183.   if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
  2184.     ln $srcdir/$ac_source $ac_dest; then :
  2185.   else
  2186.     AC_MSG_ERROR(can not link $ac_dest to $srcdir/$ac_source)
  2187.   fi
  2188. done
  2189. ])
  2190.  
  2191. dnl This is a subroutine of AC_OUTPUT.
  2192. dnl It is called after running config.status.
  2193. dnl AC_OUTPUT_SUBDIRS(DIRECTORY...)
  2194. define(AC_OUTPUT_SUBDIRS,
  2195. [
  2196. if test "$no_recursion" != yes; then
  2197.  
  2198.   # Remove --cache-file and --srcdir arguments so they do not pile up.
  2199.   ac_sub_configure_args=
  2200.   ac_prev=
  2201.   for ac_arg in $ac_configure_args; do
  2202.     if test -n "$ac_prev"; then
  2203.       ac_prev=
  2204.       continue
  2205.     fi
  2206.     case "$ac_arg" in
  2207.     -cache-file | --cache-file | --cache-fil | --cache-fi \
  2208.     | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
  2209.       ac_prev=cache_file ;;
  2210.     -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  2211.     | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
  2212.       ;;
  2213.     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  2214.       ac_prev=srcdir ;;
  2215.     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  2216.       ;;
  2217.     *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
  2218.     esac
  2219.   done
  2220.  
  2221.   for ac_config_dir in $1; do
  2222.  
  2223.     # Do not complain, so a configure script can configure whichever
  2224.     # parts of a large source tree are present.
  2225.     if test ! -d $srcdir/$ac_config_dir; then
  2226.       continue
  2227.     fi
  2228.  
  2229.     echo configuring in $ac_config_dir
  2230.  
  2231.     case "$srcdir" in
  2232.     .) ;;
  2233.     *)
  2234.       if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
  2235.       else
  2236.         AC_MSG_ERROR(can not create `pwd`/$ac_config_dir)
  2237.       fi
  2238.       ;;
  2239.     esac
  2240.  
  2241.     ac_popdir=`pwd`
  2242.     cd $ac_config_dir
  2243.  
  2244.     case "$srcdir" in
  2245.     .) # No --srcdir option.  We are building in place.
  2246.       ac_sub_srcdir=$srcdir ;;
  2247.     /*) # Absolute path.
  2248.       ac_sub_srcdir=$srcdir/$ac_config_dir ;;
  2249.     *) # Relative path.
  2250.       ac_sub_srcdir=../$srcdir/$ac_config_dir ;;
  2251.     esac
  2252.  
  2253.     # Check for guested configure; otherwise get Cygnus style configure.
  2254.     if test -f $ac_sub_srcdir/configure; then
  2255.       ac_sub_configure=$ac_sub_srcdir/configure
  2256.     elif test -f $ac_sub_srcdir/configure.in; then
  2257.       ac_sub_configure=$ac_configure
  2258.     else
  2259.       AC_MSG_WARN(no configuration information is in $ac_config_dir)
  2260.       ac_sub_configure=
  2261.     fi
  2262.  
  2263.     # The recursion is here.
  2264.     if test -n "$ac_sub_configure"; then
  2265.  
  2266.       # Make the cache file name correct relative to the subdirectory.
  2267. changequote(, )dnl
  2268.       # A "../" for each directory in /$ac_config_dir.
  2269.       ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
  2270. changequote([, ])dnl
  2271.       case "$cache_file" in
  2272.       /*) ac_sub_cache_file=$cache_file ;;
  2273.       *) # Relative path.
  2274.         ac_sub_cache_file="$ac_dots$cache_file" ;;
  2275.       esac
  2276. ifdef([AC_PROVIDE_AC_PROG_INSTALL],
  2277.       [  case "$ac_given_INSTALL" in
  2278. changequote(, )dnl
  2279.         [/$]*) INSTALL="$ac_given_INSTALL" ;;
  2280. changequote([, ])dnl
  2281.         *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
  2282.         esac
  2283. ])dnl
  2284.  
  2285.       echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir"
  2286.       # The eval makes quoting arguments work.
  2287.       if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
  2288.       then :
  2289.       else
  2290.         AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir)
  2291.       fi
  2292.     fi
  2293.  
  2294.     cd $ac_popdir
  2295.   done
  2296. fi
  2297. ])
  2298.